package com.gscitysfy.cus.drain.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Administrator
 */
public class DistrictConverter {

    /**
     * @author: wuxx
     * @date: 2022/4/26
     * @description: 区划编码缓存变量map
     */
    public static Map<String, String> allConstants = new HashMap<>();


    public static void setAllConstants(String code,String name) {
        if(null!=name){
            DistrictConverter.allConstants.put(code,name);
        }
    }

    /**
     * @auther: wuxinxin
     * @date: 2022/6/17 18:03
     * @Description: 根据编码获取区划名称
     * @param code
     * @return java.util.Map<java.lang.String,java.lang.String>
     */
    public static String getDistrictName(String code) {
        if(null== DistrictConverter.allConstants){
            return null;
        }
        return DistrictConverter.allConstants.get(code);
    }
}
